//******************************************************************************
// TITLE:                      	Using Classes + Inheritance 
// FILENAME:                   	BillingTN.cpp
// PREPARED FOR:               	CS215 Section CS13-02
// PROGRAMMER(S):              	Eric (Fox) Crowell
// DEVELOPMENT DATE:           	< 12/02/13 >
// COMPILER USED:      			Microsoft Visual Studio Ultimate 2013
// TARGET PLATFORM:         	Windows 8 x64
//================================================================

#include "BillingTN.h"

BillingTN::BillingTN(){
	cout << "In Billing Telephone Number Default Constructor.\n";
	this->NumWorkingTNs = 1;
}

BillingTN::BillingTN(const string &inNPA, const string &inNXX, const string &inLine, const string &inCustomerName, const int &inNumWorkingTNs)
: WorkingTN(inNPA, inNXX, inLine, inCustomerName){
	cout << "In Billing Telephone Number Parameterized Constructor.\n";
	
	if (inNumWorkingTNs >= 1){ this->NumWorkingTNs = inNumWorkingTNs; }
	else{ this->NumWorkingTNs = 1; }

}

BillingTN::~BillingTN(){
	cout << "In Billing Telephone Number Destructor.\n";
}

// SETTERS
void BillingTN::setNumWorkingTNs(const int &inNumWorkingTNs){
	if (inNumWorkingTNs >= 1){ this->NumWorkingTNs = inNumWorkingTNs; }
	else{ cout << "Failed to set NumWorkingTNs. Ensure the integer values is 1 or greater.\n"; }
}

// GETTERS
int BillingTN::getNumWorkingTNs() const {
	return(this->NumWorkingTNs);
}

// Virtual Function (Needed to be virtual for Polymorphism)
void BillingTN::PrintToStream(ostream &out){
	out << "Telephone Number: "
		<< this->getNPA() << "-" << this->getNXX() << "-" << this->getLine() << "\n"
		<< "Customer Name: " << this->CustomerName << "\n"
		<< "Number of Working Lines: " << this->NumWorkingTNs << "\n";
}